﻿using RazorEngine.Templating;
using RazorEngine.Text;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace CodeGenerator.Common
{
    public abstract class MyTemplateBase<T> : TemplateBase<T>
    {
        public MyTemplateBase()
        {
            this.Utils = new Utils();
        }

        public Utils Utils { get; set; }


        /// <summary>
        /// 用于输出原始html
        /// </summary>
        /// <param name="value">参数</param>
        /// <returns></returns>
        public static IEncodedString RawHtml(string value)
        {
            return new RawString(value);
        }
        /// <summary>
        /// 用于输出转义后字符
        /// </summary>
        /// <param name="value">参数</param>
        /// <returns></returns>
        public static HtmlEncodedString Text(string value)
        {
            return new HtmlEncodedString(value);
        }


        /// <summary>
        /// Pascal 规则（帕斯卡命名）
        /// 每个单词开头的字母大写
        /// </summary>
        public static string Pascal(string s)
        {
            return Utils.Pascal(s);
        }

        /// <summary>
        /// Camel  规则（驼峰命名）
        /// 每个单词开头的字母小写
        /// </summary>
        public static string Camel(string s)
        {
            return Utils.Camel(s);
        }
    }
}
